<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta charset="utf-8"/>
    <title>股票-首页</title>
    <link rel="icon" href="">
    <link rel="stylesheet" type="text/css" href="/web/static/quote/easyui/easyui.css">
    <link rel="stylesheet" type="text/css" href="/web/static/quote/easyui/icon.css">
    <link rel="stylesheet" type="text/css" href="/web/static/quote/easyui/common.css">
    <link rel="stylesheet" type="text/css" href="/web/static/quote/easyui/demo.css">
    <style type="text/css">
        button {
            cursor: pointer;
        }

    </style>


    <script type="text/javascript" src="/web/static/quote/jquery.min.js"></script>
    <script type="text/javascript" src="/web/static/quote/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/web/static/quote/easyui/datagrid-groupview.js"></script>


    {#
    <script type="text/javascript" src="js/easyui-lang-zh_CN.js"></script>
#}

</head>
<body class="easyui-layout" id="layout" style="visibility:hidden;">

<div region="north" id="header" style="height: 35px;">
    {#
    <img src="img/logo.png" class="logo"/>
#}

    <div class="top-btns" style="top:1px;">

        <span>欢迎您，{{ username }}</span>
        {#
        <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-lock'">修改密码</a>
#}
        <a href="{{ url_for('custom.logout') }}" class="easyui-linkbutton"
           data-options="plain:true,iconCls:'icon-clear'">退出系统</a>
        {#  <select class="easyui-combobox" data-options="editable:false">
            <option value="0" selected="selected">中文</option>
            <option value="1">English</option>
        </select>#}
    </div>
</div>

<div region="west" split="true" title="导航菜单" id="naver">
    <div class="easyui-accordion" fit="true" id="navmenu">

        <div title="行情分析">
            <ul class="navmenu">
                <li class="active"><a href="#" data-url="">单日市场数据</a></li>
                <li><a href="#" data-url="/page/industry/rank">行业分析</a></li>
                <li><a href="#" data-url="page/industry/time">行业分时排行榜</a></li>
                <li><a href="#" data-url="page/stock/rank">股票排行榜</a></li>
                <li><a href="#" data-url="page/stock/pool">股票池</a></li>
                <li><a href="#" data-url="page/stock/optional">自选股</a></li>
                <li><a href="#" data-url="page/stock_lifeline">生命线</a></li>
                <li><a href="#" data-url="page/stock_holder">持股信息</a></li>
            </ul>
        </div>
        <div title="首页">
            <ul class="navmenu">
                <li><a href="#" data-url="">待办事项</a></li>
                <li><a href="#" data-url="page/stock_info">基础数据维护</a></li>
                {#  <li><a href="#" data-url="html/page02.html">指标库列表</a></li>#}
            </ul>
        </div>
        <div title="股票日常数据">
            <ul class="navmenu">
                <li><a href="#" data-url="page/daily_rise_info">单日股票信息查询</a></li>
                <li><a href="#" data-url="page/manual_spider">爬虫</a></li>
            </ul>
        </div>

        <div title="news">
            <ul class="navmenu">
                <li><a href="#" data-url="page/news">新闻列表</a></li>
            </ul>
        </div>
    </div>
</div>

<div region="center" id="content" style="min-height: 400px;">
    <div class="easyui-tabs" id="tt">

        <div title="单日市场数据" iconCls="icon-ok">
            <div class="easyui-accordion">
                <div class="easyui-layout">
                    <div class="easyui-tabs">
                        <div title="单日市场数据" style="padding:1px">
                            <div style="margin:2px 0;">
                                <div id="market_toolbar" style="padding:1px;">
                                    <form action="" id="market_form">
                                        <input id="market_date" class="easyui-datebox" name="date"></input>
                                        <button type="button" id="market_search">Search</button>
                                    </form>
                                </div>
                                <div id="market_sigle_day">
                                </div>
                            </div>
                        </div>

                        <div title="行业单日数据" style="padding:1px">
                            <div style="margin:2px 0;">
                                {#行业单日数据#}
                                <div id="industry_toolbar" style="padding:1px;">
                                    <form action="" id="industry_form">
                                        <input id="industry_date" class="easyui-datebox" name="date"></input>
                                        <button type="button" id="industry_search">Search</button>
                                    </form>
                                </div>
                                <div id="industry_sigle_day">
                                </div>
                            </div>
                        </div>

                        {#   <div title="概念单日数据" style="padding:1px">
                            <div style="margin:2px 0;">
                                #}{#概念板块单日数据#}{#

                                <div id="concept_toolbar" style="padding:1px;">
                                    <form action="" id="concept_form">
                                        <input id="concept_date" class="easyui-datebox"
                                               name="date"></input>
                                        <a href="#" id="concept_search">Search</a>

                                    </form>
                                </div>
                                <div id="concept_sigle_day">
                                </div>
                            </div>
                        </div>
#}
                        {#   <div title="行业排行榜" style="padding:10px">
                            <div style="margin:20px 0;">

                                <div id="industy_agg_toolbar" style="padding:5px;height:auto">
                                    <form action="" id="industry_agg_form">
                                        <select id="week" class="easyui-combobox" name="weeks" style="width:200px;">
                                            <option value="1" selected>1周</option>
                                            <option value="2">2周</option>
                                            <option value="3">3周</option>
                                            <option value="4">4周</option>
                                        </select>

                                        <select id="topnums" class="easyui-combobox" name="tops" style="width:200px;">
                                            <option value="5">top5</option>
                                            <option value="10" selected>top10</option>
                                            <option value="15">top15</option>
                                            <option value="20">top20</option>
                                        </select>
                                        <a href="#" id="industry_rank_search">Search</a>

                                    </form>
                                </div>
                                <div id="createtable" style="margin:20px 0;">

                                </div>

                                <div id="stock_aggregation_table">
                                </div>


                            </div>
                        </div>#}

                    </div>


                </div>
            </div>
        </div>

    </div>
</div>

<div region="south" id="footer">股票管理系统 V1.0</div>

<script type="text/javascript" src="/web/static/js/index.js"></script>
<script type="text/javascript" src="/web/static/js/index_datagrid.js"></script>


<script type="text/javascript">
    $(function () {
        //添加新的Tab页
        $("#navmenu").on("click", "a[data-url]", function (e) {
            e.preventDefault();
            var tabTitle = $(this).text();
            var tabUrl = $(this).data("url");
            if ($("#tt").tabs("exists", tabTitle)) { //判断该Tab页是否已经存在
                $("#tt").tabs("select", tabTitle);
            } else {
                if (tabUrl) {
                    $("#tt").tabs("add", {
                        title: tabTitle,
                        href: tabUrl,
                        closable: true
                    });
                } else {
                    $("#tt").tabs("add", {
                        title: tabTitle,
                        href: "#",
                        closable: true
                    });
                }
            }
            $("#navmenu .active").removeClass("active");
            $(this).parent().addClass("active");
        });

        //解决闪屏的问题
        window.setTimeout(function () {
            $("#layout").css("visibility", "visible");
        }, 800);
    });
</script>

<script type="text/javascript">

    $(function () {
        $('#market_date').datebox({
            formatter: myformatter,
            parser: myparser,
            required: true
        });

        $('#industry_date').datebox({
            formatter: myformatter,
            parser: myparser,
            required: true
        });


        {#   $('#stock_date').datebox({
               formatter: myformatter,
               parser: myparser,
               required: true
           });#}

        $.ajax({
            /*type = "get",*/
            url: '/common/last_trading_date',
            dateType: "JSON",
            timeout: 1000,
            success: function (data, textStatus, jqXHR) {
                // alert(data)
                $('#market_date').datebox('setValue', data);
                $('#industry_date').datebox('setValue', data);
                {#$('#concept_date').datebox('setValue', data);#}
                {#
                                $('#stock_date').datebox('setValue', data);
                #}
            },
            error: function (xhr, textStatus) {
                if (textStatus == 'timeout') {
                    // Treat timeout logic
                    $.messager.alert("操作提示", "timeout！", "warning");
                } else {
                    console.log('error:' + textStatus);

                }
            }
        });

    })

</script>

</body>
</html>
